package org.java.dao.DaoImpl;

import org.java.entity.Artists;
import org.java.util.JDBCUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class ArtistsDao {
    private JdbcTemplate jdbcTemplate=new JdbcTemplate(JDBCUtil.getDataSource());

    public List<Artists> getList() {
        String sql = "select * from artist";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(Artists.class));
    }
}

